package com.xxyf.config.webMvc;

import com.xxyf.domain.Code;

import com.xxyf.eoro.RunAuth;
import com.xxyf.tools.Rest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 小小怡飞
 * @Date 2022/12/15 21:41
 * @Version JDK 8
 */
@ControllerAdvice
public class MyControllerAdvice {

    @ExceptionHandler(RunAuth.class)
    @ResponseBody
    public Rest rest(Exception e){
        return new Rest(1002,e.getMessage());
    }
}
